<?php
namespace app\admin\controller;

\think\Loader::import('controller/Controller', \think\Config::get('traits_path') , EXT);

use app\admin\Controller;
use think\Db;
class ExceptionalOrder extends Controller
{
    use \app\admin\traits\controller\Controller;
    // 方法黑名单
    protected static $blacklist = [];

    /**
     * 首页
     */
    public function index()
    {
        $map['isdelete'] = 0;
        $list = Db::name('exceptional_order')->where($map)->select();
        if ($list){
            foreach ($list as $eok=>$eov){
                $order_id =  Db::name('order')->where('id',$eov['oid'])->value('order_id');
                $list[$eok]['order_id'] = $order_id;
            }
        }
        return view('',compact('list'));
    }

    /**
     * 解决异常订单
     * @return mixed
     */
    public function solve()
    {
        $id=input('id');
        $update['solve']=true;
        $update['sole_info']="已经解决";
        $re=Db::name('exceptional_order')->where('id',$id)->update($update);
        return ajax_return_adv("标记成功");
    }
}
